Ext.onReady(function() {

	// 定义树的跟节点

		var root = new Ext.tree.TreeNode( {

			id : "root",// 根节点id
			text : "<span style='font-size:16px'>自动排课系统</span>"

		});

		// 定义树节点

		var c1 = new Ext.tree.TreeNode( {

			id : 'c1',// 子结点id
			text : "<span style='font-size:14px'>数据管理</span>"
		});

		var c12 = new Ext.tree.TreeNode( {
			id : 'c12',
			text : "<span style='font-size:14px'>课程管理</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('queryCourse.jsp');
				}
			}
		});

		var c13 = new Ext.tree.TreeNode( {

			id : 'c13',
			text : "<span style='font-size:14px'>教师管理</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('queryTeacher.jsp');
				}
			}

		});
		var c14 = new Ext.tree.TreeNode( {

			id : 'c14',

			text : "<span style='font-size:14px'>教室管理</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('queryClassroom.jsp');
				}
			}

		});

		var c15 = new Ext.tree.TreeNode( {

			id : 'c15',

			text : "<span style='font-size:14px'>班级管理</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('queryClass.jsp');
				}
			}

		});
		var c16 = new Ext.tree.TreeNode( {

			id : 'c22',

			text : "<span style='font-size:14px'>专业管理</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('queryProfessional.jsp');
				}
			}

		});

		var c17 = new Ext.tree.TreeNode( {

			id : 'c23',

			text : "<span style='font-size:14px'>系院管理</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('querySystem.jsp');
				}
			}

		});
		var c18 = new Ext.tree.TreeNode( {

			id : 'c24',

			text : "<span style='font-size:14px'>教学楼管理</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('queryTeachingbuilding.jsp');
				}
			}

		});

		var c19 = new Ext.tree.TreeNode( {

			id : 'c25',

			text : "<span style='font-size:14px'>管理员管理</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('queryAdmin.jsp');
				}
			}
		});
		
		var c20 = new Ext.tree.TreeNode( {

			id : 'c26',

			text : "<span style='font-size:14px'>自动生成教学计划</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('schedulePlan.jsp');
				}
			}
		});
		root.appendChild(c1);// 为根节点增加子结点c1
		c1.appendChild(c12);
		c1.appendChild(c13);
		c1.appendChild(c14);
		c1.appendChild(c15);
		c1.appendChild(c16);
		c1.appendChild(c17);
		c1.appendChild(c18);
		c1.appendChild(c19);
		c1.appendChild(c20);

		var c3 = new Ext.tree.TreeNode( {

			id : 'c3',// 子结点id
			text : "<span style='font-size:14px'>排课功能</span>"
		});

		var c32 = new Ext.tree.TreeNode( {
			id : 'c32',
			text : "<span style='font-size:14px'>自动排课</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('autopk.jsp');
				}
			}

		});

		var c35 = new Ext.tree.TreeNode( {

			id : 'c35',

			text : "<span style='font-size:14px'>课表操作</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('ShowPaiKeAll.jsp');
				}
			}

		});
		var c36 = new Ext.tree.TreeNode( {

			id : 'c36',

			text : "<span style='font-size:14px'>教学计划</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('querySchedule.jsp');
				}
			}

		});
		
		root.appendChild(c3);// 为根节点增加子结点c3

		c3.appendChild(c32);
		c3.appendChild(c35);
		c3.appendChild(c36);

		var c4 = new Ext.tree.TreeNode( {

			id : 'c4',// 子结点id

			text : "<span style='font-size:14px'>数据维护</span>"

		});

		var c42 = new Ext.tree.TreeNode( {

			id : 'c42',

			text : "<span style='font-size:14px'>备份数据</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('MysqlBak.jsp');
				}
			}
		});

		var c43 = new Ext.tree.TreeNode( {

			id : 'c43',
			text : "<span style='font-size:14px'>还原数据</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('MysqlRec.jsp');
				}
			}

		});
		var c44 = new Ext.tree.TreeNode( {

			id : 'c44',

			text : "<span style='font-size:14px'>初始化数据</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('MysqlInit.jsp');
				}
			}
		});
		var c45 = new Ext.tree.TreeNode( {

			id : 'c45',

			text : "<span style='font-size:14px'>备份最终排课方案</span>",
			listeners : {// 监听
				"click" : function(node, e) {
					window.parent.frames['mainFrame'].location
							.reload('MysqlPKBak.jsp');
				}
			}
		});
		root.appendChild(c4);// 为根节点增加子结点c4

		c4.appendChild(c42);// 为c4增加子节点c42
		c4.appendChild(c43);// 为c4增加子节点c42
		c4.appendChild(c44);// 为c4增加子节点c42
		c4.appendChild(c45);// 为c4增加子节点c45

		// 生成树形面板

		var tree = new Ext.tree.TreePanel( {

			renderTo : "show",

			root : root,// 定位到根节点

			animate : true,// 开启动画效果

			enableDD : false,// 不允许子节点拖动

			border : false,// 有边框

			rootVisible : true
		// 设为false将隐藏根节点，很多情况下，我们选择隐藏根节点增加美观性

				});

	})
